home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / CVersCaption 1.3.1 / CVersCaption README next >
Encoding:
Text File  |  1997-07-12  |  9.7 KB  |  242 lines  |  [TEXT/CWIE]

  1. /*******************************************************************************\
  2. |                                                                                |
  3. |  CVersCaption ©1997 John C. Daub.  All rights reserved                        |
  4. |                                                                                |
  5. |  John C. Daub <mailto:hsoi@eden.com>                                            |
  6. |  <http://www.eden.com/~hsoi/>  <http://www.eden.com/~hsoi/prog.html>            |
  7. |                                                                                |
  8. \*******************************************************************************/
  9.  
  10.  
  11. DESCRIPTION
  12. ```````````
  13.  
  14. A Metrowerks PowerPlant® inherited class that automatically displays an
  15. application version (e.g. in the About Box or something).  All you have to
  16. do is make sure there is a 'vers' #1 resource in your application's resource
  17. fork, and then just make an instance of your object in some window/dialog
  18. (like while creating your 'PPob's in Constructor), (don't forget to register
  19. this class).  It's pretty simple.
  20.  
  21. Attempts to take advantage of advancements in PowerPlant (e.g. CTYP resources,
  22. elimination of CreateFromStream in favor of RegisterClass_(), etc) but also
  23. tries to maintain backwards compatability.
  24.  
  25.  
  26. USAGE
  27. `````
  28.  
  29. Use of this class is fairly simple actually.
  30.  
  31. Place the custom types into their proper location for Constructor to
  32. find them.
  33.  
  34. Constructor Version  |  File to Use         |  Location to Place it
  35. ------------------------------------------------------------------------
  36. less than 2.4          CVersCaption.CPPb      Same folder as Constructor app
  37.  
  38. 2.4 or 2.4.1           CVersCaption.CTYP      Same folder as Constructor app
  39.  
  40. 2.4.2 or greater       CVersCaption.CTYP      "Custom Types" folder
  41.  
  42. (Re)launch Constructor and the custom type will be visible in the Catalog
  43. window. Just drag an instance of the object into your PPob.
  44.  
  45. Most of the property fields are the same as an LCaption. We add:
  46.  
  47. Use string version        - Uses the "shortVersion" of the VersRec, which is
  48.                           a Pascal-style string, if true. If false, the
  49.                           version information is extracted from the NumVersion
  50.                           of the VersRec.
  51.  
  52. Print country code      - If true, appends the countryCode (from the VersRec)
  53.                           to the end of the version string.
  54.  
  55.  
  56. Of course you don't need to use a PPob/LStream to create an object of this
  57. type; a parameterized constructor, copy constructor (and assignment
  58. operator) and of course default constructor are all provided for your
  59. convenience.
  60.  
  61. Of course ensure CVersCaption.cp is in your project and that you register
  62. the class (if you do create it from an LStream).
  63.  
  64. Finally, ensure you have a resource of type 'vers' and ID #1 in your
  65. project/application.
  66.  
  67. That's it!
  68.  
  69.  
  70. CREDITS
  71. ```````
  72.  
  73. This code was inspired by something I saw Robin Mair do in an
  74. example project of his (Eric Scouten had something very similar...dunno
  75. who did it first).  Then a little coding help from Michael Trent
  76. in the "Tips & Tidbits" from MacTech Jan '97.
  77.  
  78.  
  79. DISCLAIMER
  80. ``````````
  81.  
  82. This is NOT a product of Metrowerks Corporation.  Please do NOT contact Metrowerks
  83. for help/support of this class/code.  If you need support, please use the contact
  84. information given below.
  85.  
  86.  
  87. LICENSING AND USAGE AGREEMENT
  88. `````````````````````````````
  89.  
  90. John C. Daub (author) grants you, and you accept, a nonexclusive, nontransferable
  91. license to distribute this code for you within your programs and projects.  You may
  92. distribute this code in object code form only and only on magnetic diskettes,
  93. CD-ROM, or other media with your programs into which this code has been
  94. incorporated (if you need to distribute your program by some other medium, please
  95. contact the author).  You agree that this license gives you no title nor rights
  96. of ownership in, of, and/or to this code, and acknowledge that this code
  97. is property of John C. Daub.  This code is NOT in the public domain.
  98.  
  99. Permission is granted to the following organizations to distribute this
  100. code on their CD-ROM collections:
  101.  
  102. Pacific HiTech, Inc            - Info-Mac CD-ROM
  103. Celestin Company            - Apprentice CD
  104. Meterowerks Corporation        - CodeWarrior
  105.  
  106. If you and/or your organization wishes to distribute this code and are
  107. not explicitly listed above, please contact John C. Daub.
  108.  
  109. You may modify the source code, compile it, and incorporate the resulting object
  110. code into your programs.  If you modify the code, you cannot redistribute the
  111. modified code under the same class/code name.  Furthermore, to prevent any
  112. problems and/or infringements, please contact the author prior to redistribution
  113. of any modified code.
  114.  
  115. John C. Daub licenses this code to you on an "AS IS" basis.  John C. Daub makes
  116. no warranties, neither expressed nor implied, regarding this code, its
  117. merchantability, nor its fitness for any purpose.  John C. Daub agrees to make a
  118. reasonable effort to provide written or verbal corrections for any problems
  119. that might be found in this code.
  120.  
  121. Use of this code must be credited in an appropriate manner and location (such
  122. as printed or online documentation and/or About boxes) with the following
  123. credit line:
  124.  
  125.      CVersCaption ©1997 John C. Daub.  All rights reserved.
  126.  
  127. If this license is too restrictive with the current law in your state or country,
  128. you should not use this code at all.  Furthermore, if you personally find this
  129. agreement too restrictive or not to your satisfaction, you should not use this
  130. code at all.
  131.  
  132.  
  133. FUTURE
  134. ``````
  135.  
  136. - Country codes are partially implimented..they're there, but it's not
  137.   stellar.  I know there have got to be more country codes out there than
  138.   what was listed in ResEdit/Resorcerer.  If you know of any missing, please
  139.   let me know.
  140.   
  141.   Also, I would really prefer to use abbreviations for the country codes,
  142.   like 2 character codes, e.g. "It" for Italy (or whatever the proper code
  143.   is).  If you know the proper abbreviations for these countries, please do
  144.   let me know.  Or if you know of a complete listing of this information, again
  145.   do let me know.
  146.   
  147. - Fix bugs, if any (hopefully not) :)
  148.  
  149. - According to IM:Toolbox Essentials, 7-32, if an app doesn't contain
  150.   a 'vers' #1, the Finder displays the string from the signature resource
  151.   as version number. That might be a nice alternative to a missing 'vers' #1.
  152.  
  153.  
  154. CONTACT INFORMATION
  155. ```````````````````
  156.  
  157. Even though you don't need to send me email or register or anything to
  158. use the code, it would still be nice to drop me a line and let me know
  159. what you think.  If you find any bugs or add any cool features, send them
  160. to me so I can add it to the official distribution. Furthermore, if I
  161. have your contact information, I can notify you when new versions are
  162. released -- can be very handy if say there is a fatal crashing bug
  163. in the code or some such. So, it's probably in your own best interest
  164. to drop me a line :-)
  165.  
  166. Also, be sure to visit my web site
  167.  
  168. <http://www.eden.com/~hsoi/prog.html>
  169.  
  170. and "register". I won't know if you're "registered" or not, but it's a nice
  171. way that you can be notified of product updates (e.g. I make a new
  172. version, post it on that page, if you're registered, you'll be emailed
  173. automatically that the page changed).
  174.  
  175. John C. Daub
  176. <mailto:hsoi@eden.com>
  177. <http://www.eden.com/~hsoi/prog.html>
  178.  
  179.  
  180. CHANGE HISTORY
  181. ``````````````
  182.  
  183. Date        Vers    Who        Notes
  184. ----------------------------------------------------------------------------
  185. 01 Jan 97    1.0        JCD        - Created file
  186.  
  187. 20 Jan 97    1.1        JCD        - fixed a bug (thanx to Wilfried Bernard) with
  188.                             extracting the pre-release number (nonRelRev).
  189.  
  190. 21 Jan 97    1.2        JCD        - added mUseShortString to allow the choice of
  191.                             using the VersRec.shortString, or the NumVersion.
  192.                             Modified the CPPb/CTYP to fit.
  193.                             - stored all the string literals in 'STR '
  194.                             resources for kinder localization.  Class now
  195.                             requires the addition of "CVersCaption.rsrc" to one's
  196.                             project file.
  197.                             - created this seperate README to clean up the source
  198.                             file's appearance a bit.
  199.                             - added support to print the country codes, if desired.
  200.                             Not to a point where I want it, tho...lacking all the
  201.                             existing country codes, plus lacking the abbreviated
  202.                             versions of the countries.  That looks better, IMHO.
  203.  
  204. 26 Jan 97    1.2.1    JCD        - added a little #ifdef to contend with DebugNew (if
  205.                             used)
  206.  
  207. 19 Feb 97    1.2.2    JCD        - updated the licensing information
  208.                             - minor tweaks and fixes
  209.                             - Added functionality so that if the pane is not active
  210.                             then the text is drawn dimmed.  Required adding/overriding
  211.                             ActivateSelf, DeactivateSelf, DrawSelf.
  212.  
  213. 14 May 97    1.3        JCD        - Split custom types into seperate files for easier
  214.                             management.
  215.                             - Upgraded to CodeWarrior Professional 1
  216.                             - Updated demo application
  217.                             - Changed some throw macros to use more appropriate
  218.                             versions (e.g. ResFail instead of MemFail after GetString())
  219.                             - Updated licensing agreement
  220.                             - Cleaned up the sources to compile with no precompiled
  221.                             header file
  222.                             - Added assignment operator (rule of 3's, see C++ FAQs by
  223.                             Marshall Cline)
  224.                             - Cleaned up the source cosmetics to improve readability
  225.                             - Made DrawSelf protected, as it should be.
  226.                             - mText now initialized to nil before proceeding, where
  227.                             appropriate.
  228.                             - mVersion now Uint32 instead of Int32 (as per Types.h)
  229.  
  230. 12 July 97    1.3.1    JCD        - All ctor's use initialization lists instead of
  231.                             assignment (where possible).
  232.                             - All member data is now private (was protected). Appropriate
  233.                             accessor functions have been created (as public or
  234.                             protected, depending on context). Helps to further abstract
  235.                             the user away from the data (good C++ style).
  236.                             - Added include for PowerPlant_PCH to be consistant with
  237.                             PowerPlant sources.
  238.                             - Inline functions no longer defined within class declaration.
  239.                             Definitions moved outside of the class, but still in the header
  240.                             file. #pragma mark's added to source file to ease navigation
  241.                             and user indexing.
  242.                             - Added a "Usage" section to this README.